package com.ruoyi.web.xxj.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;

/**
 * 课程订单对象 class_order
 *
 * @author ruoyi
 * @date 2024-01-24
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@ApiModel("课程订单对象")
public class ClassOrder implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @ApiModelProperty("课程订单主键ID")
    private Long id;

    /**
     * 订单编号
     */
    @ApiModelProperty("课程订单编号")
    @Excel(name = "课程订单编号")
    private String orderNo;

    /**
     * 课程退款订单编号
     */
    @ApiModelProperty("课程退款订单编号")
    @Excel(name = "课程退款订单编号")
    private String refundNo;

    @ApiModelProperty("微信交易流水编号")
    @Excel(name = "微信交易流水编号")
    private String wxpayTradeNo;

    /**
     * 小程序用户主键ID
     */
    @ApiModelProperty("小程序用户主键ID")
    @Excel(name = "小程序用户主键ID")
    private Long wechatUserid;

    /**
     * 课程主键ID
     */
    @NotNull
    @ApiModelProperty("课程主键ID")
    @Excel(name = "课程主键ID")
    private Long classId;

    /**
     * 课程名称
     */
    @ApiModelProperty("课程名称")
    @Excel(name = "课程名称")
    private String className;

    /**
     * 家长姓名
     */
    @NotBlank
    @ApiModelProperty("家长姓名")
    @Excel(name = "家长姓名")
    private String parentName;

    /**
     * 家长电话
     */
    @NotBlank
    @ApiModelProperty("家长电话")
    @Excel(name = "家长电话")
    private String parentPhone;

    /**
     * 孩子名字
     */
    @NotBlank
    @ApiModelProperty("孩子名字")
    @Excel(name = "孩子名字")
    private String childName;

    /**
     * 孩子身份证
     */

    @Excel(name = "孩子身份证")
    @ApiModelProperty("孩子身份证")
    private String childIdcard;

    /**
     * 孩子学校名称
     */
    @NotBlank
    @ApiModelProperty("孩子学校名称")
    @Excel(name = "孩子学校名称")
    private String childSchool;

    /**
     * 孩子年级
     */
    @NotBlank
    @ApiModelProperty("孩子年级")
    @Excel(name = "孩子年级")
    private String childGrade;

    /**
     * 孩子班级
     */
    @NotBlank
    @ApiModelProperty("孩子班级")
    @Excel(name = "孩子班级")
    private String childClass;

    @ApiModelProperty("支付金额")
    @Excel(name = "支付金额")
    private BigDecimal payAmount;

    /**
     * 支付状态：0-未支付；1-已支付；2-退款待审核；3-退款通过审核；4-拒绝退款；5-已退款；6-退款失败；7-取消订单
     */
    @ApiModelProperty("支付状态：0-未支付；1-已支付；2-退款待审核；3-退款通过审核；4-拒绝退款；5-已退款；6-退款失败；7-取消订单")
    @Excel(name = "支付状态",readConverterExp = "0=未支付,1=已支付,2=退款待审核,3=退款通过审核,4=拒绝退款,5=已退款,6=退款失败,7=取消订单")
    private String payStatus;

    @ApiModelProperty("取消订单原因")
    @Excel(name = "取消订单原因")
    private String cancelReason;

    @ApiModelProperty("拒绝取消订单原因")
    @Excel(name = "拒绝取消订单原因")
    private String rejectCancelReason;
    
    @ApiModelProperty("文创订单主键ID")
    private Long productOrderId;
    
    /**
     * 备注
     */
    @ApiModelProperty("备注")
    @Excel(name = "备注")
    private String remark;
    
    /**
     * 创建者
     */
    @ApiModelProperty("创建者")
    private String createBy;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;

    /**
     * 更新者
     */
    @ApiModelProperty("更新者")
    private String updateBy;

    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;

    public ClassOrder(@NotNull Long classId, @NotBlank String childName, @NotBlank String childSchool, @NotBlank String childGrade,
                      @NotBlank String childClass) {
        super();
        this.classId = classId;
        this.childName = childName;
        this.childSchool = childSchool;
        this.childGrade = childGrade;
        this.childClass = childClass;
    }

    public ClassOrder(Long wechatUserid, String payStatus) {
        super();
        this.wechatUserid = wechatUserid;
        this.payStatus = payStatus;
    }

    public ClassOrder(String orderNo, String wxpayTradeNo) {
        super();
        this.orderNo = orderNo;
        this.wxpayTradeNo = wxpayTradeNo;
    }

}


